var t = require("../common/index.js");

Component({
    properties: {
        data: {
            type: Object
        },
        floorIndex: {
            type: Number
        },
        imgHeight: {
            type: Number,
            value: 350
        }
    },
    data: {
        current: 0,
        duration: 800,
        autoplay: !0,
        interval: 4000,
        indicatorDots: !1,
        circular: !0
    },
    methods: {
        changeCurrent: function(t) {
            var e = t.detail.current;
            this.setData({
                current: e
            });
        },
        goLink: function(e) {
          console.log('slider e',e)
          var a = e.currentTarget.dataset, d = e.currentTarget.offsetTop,
            r = a.item, o = r.linkType, i = r.data, n = a.positionIndex
            console.log('o',o)
            if(o=='notice'){
              var p = this.data.floorIndex;
              (0, t.goLink)({
                type: "notice",
                data: {
                  type: o,
                  item: r
                },
                saOption: {
                  componentName: "slider",
                  floorIndex: p,
                  positionIndex: n,
                  offsetTop: d
                }
              });
            } else if (o=='product') {
                var p = this.data.floorIndex;
                (0, t.goLink)({
                    type: "product",
                    data: {
                        type: o,
                        item: r
                    },
                    saOption: {
                        componentName: "slider",
                        floorIndex: p,
                        positionIndex: n,
                        // timestamp: s,
                        offsetTop: d
                    }
                });
            } else if (o == 'article') {
              var p = this.data.floorIndex;
              (0, t.goLink)({
                type: "article",
                data: {
                  type: o,
                  item: r
                },
                saOption: {
                  componentName: "slider",
                  floorIndex: p,
                  positionIndex: n,
                  // timestamp: s,
                  offsetTop: d
                }
              });
            }else if(o=='page'){
              var p = this.data.floorIndex;
              (0, t.goLink)({
                type: "page",
                data: {
                  type: o,
                  item: r
                },
                saOption: {
                  componentName: "slider",
                  floorIndex: p,
                  positionIndex: n,
                  // timestamp: s,
                  offsetTop: d
                }
              });
            }
        }
    }
});